﻿using PWManager.Models;
using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace PWManager
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            using (PWManagerContext db = new PWManagerContext())
            {
                if (!db.Database.Exists())
                {
                    bool success = db.Database.CreateIfNotExists();
                }
            }
            Navigator.mainWindow = this;
            Navigator.Navigate(new LoginScreen());
        }

        public void Navigate(UserControl page)
        {
            this.Content = page;
        }
    }
}
